import type { LoginResult } from '@/types/member'
import { http } from '@/utils/http'

// 小程序登录(个人账户用不了,企业才行)
type loginParams = {
  code: string
  encryptedData: string
  iv: string
}

export const postLoginWeixinAPI = (data: loginParams) => {
  return http<LoginResult>({
    url: '/login/wxMin',
    method: 'POST',
    data,
  })
}

// 小程序登录(目前使用的)
type loginParams2 = {
  phoneNumber: string
}

export const postLoginWeixinSimpleAPI = (data: loginParams2) => {
  return http<LoginResult>({
    url: '/login/wxMin/simple',
    method: 'POST',
    data,
  })
}
